<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>{:C('sitename')}后台登录</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__PUBLIC__/ekadmin/css/font.css">
    <link rel="stylesheet" href="__PUBLIC__/ekadmin/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/ekadmin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__PUBLIC__/ekadmin/js/xadmin.js"></script>

</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">{:C('sitename')}后台登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" action="{:U('dologin')}" >
            <input name="username" placeholder="用户名"  type="text" lay-verify="required|username" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required|pass" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <div class="layui-input-inline">
            <input name="verify" placeholder="验证码"  type="text" lay-verify="required" class="layui-input" >
            </div>
            <img style="cursor:pointer;" src="{:U('login/verify')}" id="v" width="150" height="50" title="看不清楚？点击刷新" onclick="this.src = '{:U('login/verify')}?'+new Date().getTime()">
            <hr class="hr15">


            <a  class="layui-btn" lay-filter="submit" style="width: 100%" lay-submit="submit">
                登录
            </a>
            <hr class="hr20" >
            <p style="text-align: center">技术支持:江苏易邦信息技术有限公司</p>
        </form>
    </div>

    <script>

            layui.use(['form','layer'], function () {
                $ = layui.jquery;
                var form = layui.form
                    ,layer = layui.layer;


                form.verify({
                    username: function (value) {
                        if (value.length < 5) {
                            return '登录名至少5个字符';
                        }
                    }
                    , pass: [/(.+){6,12}$/, '密码必须6到12位']

                });

                form.on('submit(submit)', function(data){

                    var url = data.form.action;
                    $.ajax({
                        url:url,
                        method:"post",
                        dataType:"json",
                        data: data.field,
                        success: function(res){
                            if(res.code){
                                layer.msg(res.msg,{icon:5});
                                $('#v').click();
                                return false;
                            }else{

                                layer.msg(res.msg,{icon:6,time:1500},function () {
                                    window.location.href=res.data;
                                })
                            }
                        },
                        fail:function(){
                            layer.msg("服务器繁忙",{icon: 5});
                        },
                    });

                });



            })



    </script>

